import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-03-05
 * Time: 9:57
 */

class Animal{
    public String name;
    public int age;

    void eat(){};

    void method(){
        System.out.println("渣渣");
    }
}
class Cat extends Animal{
    @Override
    void eat() {
        System.out.println("吃猫粮");
    }

    void method(){
        super.method();
    }
}

public class Test {
    public static int facsum(int n) {
        int sum = 0;
        int sum1 = 1;
        for (int i = 1; i <= n; i++) {
            sum1 *= i;
            sum += sum1;
        }
        return sum;
    }
    public static void main(String[] args) {
        System.out.println(facsum(5));
    }
    public static int facsum1(int n){
        if (n == 0){
            return 0;
        }
        int sum = 1;
        for (int i = 1; i <= n ; i++) {
            sum *= i;
        }
        return sum;
    }
    public static void main5(String[] args) {
        int n = 5;
        System.out.println(facsum(n));
    }
    public static boolean max2(int x,int y){
        if(x>y){
            return true;
        }
        return false;
    }
    public static int max3(int x,int y,int z){
        if (max2(x,y)){
            if (max2(x,z)){
                return x;
            }else {
                return z;
            }
        }else {
            if (max2(y,z)){
                return y;
            }else {
                return z;
            }
        }
    }
    public static void main4(String[] args) {
        int x = 5;
        int y = 2;
        int z = 7;
        int ret = max3(x,y,z);
        System.out.println(ret);
    }

    public static double sum(int n){
        double sum = 0;
        int y = 1;
        for (int i = 1; i <= n; i++) {
            int x = y * i;
            sum += 1.0 / x;
            y = -n;
        }
        return sum;
    }
    public static void main3(String[] args) {
        int n = 100;
        double ret = sum(n);
        System.out.println(ret);
    }

    public static void oddPrint(int n){
        for (int i = 0; i < n/2; i++) {
            for (int j = 0; j < i; j++) {
                System.out.print(" ");
            }
            System.out.print("*");
            for (int j = 0; j < n - 2*(i + 1); j++) {
                System.out.print(" ");
            }
            System.out.println("*");
        }
        for (int i = 0; i < n/2; i++) {
            System.out.print(" ");
        }
        System.out.println("*");
        for (int i = 0; i < n/2 ; i++) {
            for (int j = 0; j < (n/2 - i - 1); j++) {
                System.out.print(" ");
            }
            System.out.print("*");
            for (int j = 0; j < 2 * i + 1; j++) {
                System.out.print(" ");
            }
            System.out.println("*");
        }
    }
    
    public static void evenPrint(int n){
        for (int i = 0; i < n/2; i++) {
            for (int j = 0; j < i; j++) {
                System.out.print(" ");
            }
            System.out.print("*");
            for (int j = 0; j < n - 2 * (i +1); j++) {
                System.out.print(" ");
            }
            System.out.println("*");
        }
        for (int i = 0; i < n/2; i++) {
            for (int j = 0; j < n/2 - i - 1; j++) {
                System.out.print(" ");
            }
            System.out.print("*");
            for (int j = 0; j < 2 * i; j++) {
                System.out.print(" ");
            }
            System.out.println("*");
        }
    }
    
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextInt()){
            int n = scanner.nextInt();
            if (n % 2 ==0){
                evenPrint(n);
            }else{
                oddPrint(n);
            }
        }

    }
    public static void main1(String[] args) {
        Animal animal = new Cat();
        animal.eat();
        animal.method();
    }
}
